//
//  PPShopAnnotation.m
//  pet
//
//  Created by Frank on 9/6/14.
//  Copyright (c) 2014 whalefin. All rights reserved.
//

#import "PPShopAnnotation.h"

@implementation PPShopAnnotation

+ (PPShopAnnotation *)annotationForPetShop:(PPShop *)petShop
{
    PPShopAnnotation *annotation = [[PPShopAnnotation alloc] init];
    annotation.shop = petShop;
    return annotation;
}

- (NSString *)title
{
    NSString *string = [NSString stringWithFormat:@" %@ %@ ", self.shop.name, self.shop.telephone];
    return string;
}

- (NSString *)subtitle
{
    return self.shop.address;
}

- (CLLocationCoordinate2D)coordinate
{
    CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(self.shop.latitude, self.shop.longitude);
    NSDictionary *userCoordDict = BMKConvertBaiduCoorFrom(coordinate, BMK_COORDTYPE_COMMON);
    coordinate = BMKCoorDictionaryDecode(userCoordDict);
    return coordinate;
}

@end
